//
//  @ Project : Galaxy Star Trading System
//  @ File Name : InnerFunction.h
//  @ Date : 2014/9/5
//  @ Author :
//
//

#if !defined(_INNERFUNCTION_H_H)
#define _INNERFUNCTION_H_H

namespace GSTrader
{
	namespace TradeStrategy
	{
		class CInnerImpl;
		class TRADE_STRATEGY_API CInnerFunc
		{
		public:
			CInnerFunc(CFramework* pFramework);
			virtual ~CInnerFunc();

			static bool SendOrder(string strAccount, string strInsID, int nType,
				string strExchangeID, double dPrice, int nPriceLevel, int nSide, int nOpenClose);

			static bool LimitOrder(string strAccount, string strInsID, 
				string strExchangeID, double dPrice, int nPriceLevel, int nSide, int nOpenClose);


			static void CancelOrder(COrder* pOrder);
			static void CancelAllOrder();
			int GetExpireDateById(int nInstrumentId);
			
			int GetExpireDateBySymbol(int nProviderId, string strInstrumentSymbol);

			double GetQuoteById(int nInstrumentId, int nIndex);
			double GetQuoteBySymbol(int nProviderId, string strInstrumentSymbol, int nIndex);


		public:

			void BeginCollect(int nType);
			void EndCollect(vector<string>& vString);

		private:
			CInnerImpl* m_pInnerImpl;
			CFramework* m_pFramework;

			int m_nSymbol;
			map<string, int> m_mapSymbol; // 
		};
	
	}
}

#endif // _INNERFUNCTION_H_H
